#pragma once

#include "MapCell.h"
#include "../GameObjects/Tree.h"
#include "../Math/Vec2i.h"
#include <libtcod\libtcod.hpp>
#include <memory>
#include <vector>

typedef std::shared_ptr<TCODHeightMap> TCODHeightMapPtr;
typedef std::shared_ptr<TCODMap> TCODMapPtr;
typedef std::shared_ptr<TCODNoise> TCODNoisePtr;

class Forest
{
public:
	Forest(const Vec2i &size);
	Forest(Vec2i &&size);
	Forest(int width, int height);
	~Forest();

	void init();
	void update();
	void render();

	const Vec2i &getMapSize() const { return map_size; }
	const MapCellPtr &getCellAt(const Vec2i &pos);

	const TCODMapPtr &getFOV() const { return fov_map; }

private:
	TCODHeightMapPtr height_map;
	TCODNoisePtr noise;
	TCODMapPtr fov_map;
	Vec2i map_size;
	std::vector<MapCellPtr> cells;
	MapCellPtr null_cell;

	std::vector<TreePtr> trees;
};
typedef std::shared_ptr<Forest> ForestPtr;